<?php
//查询数据库
	$arr=$_GET['$id'];
	
	$sql = "select * from news_list where id ='$arr'";	
	$link = mysqli_connect("127.0.0.1","root","","news");
	mysqli_set_charset($link, "utf8");
	if(mysqli_connect_errno($link)){
		echo "连接失败".mysqli_connect_error($link);
	}
	//执行查询语句
	$res=mysqli_query($link, $sql);
	$arr=array();
	//查询语句得到的记录行数
	if(mysqli_num_rows($res)>0){
	     while($raw = mysqli_fetch_assoc($res)){
       	         $arr[]=$raw;	
		}
				echo json_encode($arr);
	}else{
		$arr['code'] = -10009;
		$arr['message'] = "获取失败";	
		echo json_encode($arr);
	}
	//返回结果给用户
?>